import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
      redirect: '/dialogue',
      children: [{
        path: 'dialogue',
        name: 'dialogue',
        component: ()=> import('../views/DialogueView.vue')
      },
      {
        path: 'translate',
        name: 'translate',
        component: ()=> import('../views/TranslateView.vue')
      },
      {
        path: 'translationHistory',
        name: 'translationHistory',
        component: ()=> import('../views/TranslationHistoryView.vue')
      }

      ]
    },
    {
      path: '/notFound',
      name: 'notFound',
      component: () => import('../views/404.vue'),
    },
    {
      path: '/:pathMatch(.*)',
      redirect: '/notFound',
    },
    {
      path: '/Login',
      name: 'Login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/RegisterView.vue')
    },
    {
      path: '/register',
      name:'register',
      component: () => import('../views/RegisterView.vue')
    },
    {
      path: '/userInfo',
      name:'userInfo',
      component: () => import('../views/UserInfoView.vue')
    },
    {
      path: '/changePassword',
      name:'changePassword',
      component: () => import('../views/ChangePasswordView.vue')
    },
    {
      path: '/wordBookList',
      name:'wordBookList',
      component: () => import('../views/WordBookList.vue')
    },
    {
      path: '/wordBookDetail',
      name:'wordBookDetail',
      component: () => import('../views/WordBookDetail.vue')
    },
    {
      path: '/grammars',
      name:'grammars',
      component: () => import('../views/GrammarsView.vue')
    },
    {
      path: '/todayLearnContentView',
      name: 'todayLearnContentView',
      component: () => import('../views/TodayLearnContentView.vue')
    }
  ],
})

export default router
